package com.itheima.exerciseTest.method40_49.method45;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class className = Class.forName("com.itheima.exerciseTest.method40_49.method45.Zi");
        Object o = className.newInstance();
        Method[] methods = className.getDeclaredMethods();
        for (Method method : methods) {
            if(method.isAnnotationPresent(Test.class)){
                method.invoke(o);
            }
        }
    }
}
